package com.zhangxx.web.common.model;

/**
 *
 * @apiNote 返回数据统一封装
 */
public class ResponseMessage<T> {

    private int resultCode;

    private String msg;

    private T content;

    public ResponseMessage() {
    }

    public ResponseMessage(T data) {
        this(ServerStatus.SUCCESS.value(), "系统消息", data);
    }

    public ResponseMessage(int code, T data) {
        this(code, "系统消息", data);
    }

    public ResponseMessage(String message) {
        this.resultCode = ServerStatus.SUCCESS.value();
        this.msg = message;
    }

    public ResponseMessage(int code, String message, T data) {
        this.resultCode = code;
        this.msg = message;
        this.content = data;
    }

    public int getCode() {
        return resultCode;
    }

    public void setResultCode(int code) {
        this.resultCode = code;
    }

    public String getMessage() {
        return msg;
    }

    public void setMessage(String message) {
        this.msg = message;
    }

    public T getContent() {
        return content;
    }

    public void setData(T data) {
        this.content = data;
    }
}
